/**
 *====================================================
 * 文件名称: AbnormalBlameEntity.java
 * 修订记录：
 * No    日期				作者(操作:具体内容)
 * 1.    2015年11月21日			chenxy(创建:创建文件)
 *====================================================
 * 类描述：(说明未实现或其它不应生成javadoc的内容)
 */
package com.yuexunit.finance.project.entity;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.yuexunit.finance.project.AuthenticatEntity;
import com.yuexunit.finance.project.AbnormalExpenseSource;
import com.yuexunit.finance.project.entity.lexicon.AbnormalSourceEnum;
import com.yuexunit.finance.project.entity.lexicon.ExpenditureEnum;
import com.yuexunit.finance.project.entity.lexicon.OperatorRoleEnum;

/**
 * @ClassName: AbnormalBlameEntity
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author chenxy
 * @date 2015年11月21日 下午1:34:15
 */
@Entity
@Table(name = "FIN_ABNORMAL_BLAME")
public class AbnormalBlameEntity extends AuthenticatEntity implements AbnormalExpenseSource {

	/** 责任人处置ID */
	@Id
	@GeneratedValue
	@Column(name = "ABNORMAL_BLAME_ID")
	private Long abnormalBlameId;

	/** 异常ID */
	@Column(name = "ABNORMAL_ID")
	private Long abnormalId;

	/** 责任人 */
	@Column(name = "BLAME_MAN")
	private String blameMan;

	/** 所属车队部门 */
	@Column(name = "DEPARMENT")
	private String deparment;

	/** 人员类别 0:未知/1:内部人员/2:供应商(物流)/3:客户(企业)/4:其他 */
	@Column(name = "MOLD")
	private Integer mold;

	/** 所属公司租户ID */
	@Column(name = "COMPANY_TENANT_ID")
	private Long companyTenantId;

	/** 所属公司ID 1:内部人员则为平台/2:供应商则为物流公司/3:客户则为企业 */
	@Column(name = "COMPANY_ID")
	private Long companyId;

	/** 所属公司 */
	@Column(name = "COMPANY")
	private String company;

	/** 职位 */
	@Column(name = "POSITION")
	private String position;

	/** 责任判定 0:未知/1:主责/2:副责/3:全责 */
	@Column(name = "LIABILITY")
	private Integer liability;

	/** 处理方式 0:未知/11:批评/12:警告/13:罚款(必须填金额)/14:通报/15:辞退 */
	@Column(name = "HANDLE_MODE")
	private Integer handleMode;

	/** 处理时间 */
	@Column(name = "HANDLE_DATE")
	private String handleDate;

	/** 罚款金额 */
	@Column(name = "ABNORMAL_AMOUNT")
	private BigDecimal abnormalAmount;

	/** 收支类型 0:未知/1:付款单/2:收款单 */
	@Column(name = "EXPENDITURE")
	private ExpenditureEnum expenditure;

	/** 费用单据 */
	@Column(name = "VOUCHER")
	private String voucher;

	/** 备注 */
	@Column(name = "REMARK")
	private String remark;

	public Long getAbnormalBlameId() {
		return abnormalBlameId;
	}

	public void setAbnormalBlameId(Long abnormalBlameId) {
		this.abnormalBlameId = abnormalBlameId;
	}

	public Long getAbnormalId() {
		return abnormalId;
	}

	public void setAbnormalId(Long abnormalId) {
		this.abnormalId = abnormalId;
	}

	public String getBlameMan() {
		return blameMan;
	}

	public void setBlameMan(String blameMan) {
		this.blameMan = blameMan;
	}

	public String getDeparment() {
		return deparment;
	}

	public void setDeparment(String deparment) {
		this.deparment = deparment;
	}

	public Integer getMold() {
		return mold;
	}

	public void setMold(Integer mold) {
		this.mold = mold;
	}

	public Long getCompanyTenantId() {
		return companyTenantId;
	}

	public void setCompanyTenantId(Long companyTenantId) {
		this.companyTenantId = companyTenantId;
	}

	public Long getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Long companyId) {
		this.companyId = companyId;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public Integer getLiability() {
		return liability;
	}

	public void setLiability(Integer liability) {
		this.liability = liability;
	}

	public Integer getHandleMode() {
		return handleMode;
	}

	public void setHandleMode(Integer handleMode) {
		this.handleMode = handleMode;
	}

	public String getHandleDate() {
		return handleDate;
	}

	public void setHandleDate(String handleDate) {
		this.handleDate = handleDate;
	}

	public BigDecimal getAbnormalAmount() {
		return abnormalAmount;
	}

	public void setAbnormalAmount(BigDecimal abnormalAmount) {
		this.abnormalAmount = abnormalAmount;
	}

	public ExpenditureEnum getExpenditure() {
		return expenditure;
	}

	public void setExpenditure(ExpenditureEnum expenditure) {
		this.expenditure = expenditure;
	}

	public String getVoucher() {
		return voucher;
	}

	public void setVoucher(String voucher) {
		this.voucher = voucher;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public AbnormalSourceEnum getAbnormalSource() {
		return AbnormalSourceEnum.BLAME;
	}

	@Override
	public Long getAbnormalSourceId() {
		return this.abnormalBlameId;
	}

	@Override
	public OperatorRoleEnum getReceiptType() {
		if (ExpenditureEnum.RECIEVEMENT != this.expenditure) {
			return null;
		}
		return OperatorRoleEnum.valueOf(this.mold);
	}

	@Override
	public Long getReceiptId() {
		if (ExpenditureEnum.RECIEVEMENT != this.expenditure) {
			return null;
		}
		return this.companyId;
	}

	@Override
	public Long getReceiptTenantId() {
		if (ExpenditureEnum.RECIEVEMENT != this.expenditure) {
			return null;
		}
		return this.companyTenantId;
	}

	@Override
	public String getReceiptName() {
		if (ExpenditureEnum.RECIEVEMENT != this.expenditure) {
			return null;
		}
		return this.company;
	}

	@Override
	public OperatorRoleEnum getDisbursementType() {
		if (ExpenditureEnum.PAYMENT != this.expenditure) {
			return null;
		}
		return OperatorRoleEnum.valueOf(this.mold);
	}

	@Override
	public Long getDisbursementId() {
		if (ExpenditureEnum.PAYMENT != this.expenditure) {
			return null;
		}
		return this.companyId;
	}

	@Override
	public Long getDisbursementTenantId() {
		if (ExpenditureEnum.PAYMENT != this.expenditure) {
			return null;
		}
		return this.companyTenantId;
	}

	@Override
	public String getDisbursementName() {
		if (ExpenditureEnum.PAYMENT != this.expenditure) {
			return null;
		}
		return this.company;
	}

}
